/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aqu.persistencia.entity;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Verito Ramirez
 *         Victor Jaramillo
 */
@Entity
@Table(name = "cxp_tiporetencion")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CxpTipoRetencion.findAll", query = "SELECT s FROM CxpTipoRetencion s"),
    @NamedQuery(name = "CxpTipoRetencion.findBycxpCodigoTipRet", query = "SELECT s FROM CxpTipoRetencion s WHERE s.cxpCodigoTipRet = :cxpCodigoTipRet"),
    @NamedQuery(name = "CxpTipoRetencion.findBycxpNombreTipRet", query = "SELECT s FROM CxpTipoRetencion s WHERE s.cxpNombreTipRet = :cxpNombreTipRet")})
public class CxpTipoRetencion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "CXP_CODIGO_TIPRET")
    private String cxpCodigoTipRet;
    @Size(max = 30)
    @Column(name = "CXP_NOMBRE_TIPRET")
    private String cxpNombreTipRet;

    public CxpTipoRetencion() {
    }

    public CxpTipoRetencion(String cxpCodigoTipRet, String cxpNombreTipRet) {
        this.cxpCodigoTipRet = cxpCodigoTipRet;
        this.cxpNombreTipRet = cxpNombreTipRet;
    }

    public String getCxpCodigoTipRet() {
        return cxpCodigoTipRet;
    }

    public void setCxpCodigoTipRet(String cxpCodigoTipRet) {
        this.cxpCodigoTipRet = cxpCodigoTipRet;
    }

    public String getCxpNombreTipRet() {
        return cxpNombreTipRet;
    }

    public void setCxpNombreTipRet(String cxpNombreTipRet) {
        this.cxpNombreTipRet = cxpNombreTipRet;
    }    
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cxpCodigoTipRet != null ? cxpCodigoTipRet.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CxpTipoRetencion)) {
            return false;
        }
        CxpTipoRetencion other = (CxpTipoRetencion) object;
        if ((this.cxpCodigoTipRet == null && other.cxpCodigoTipRet != null) || (this.cxpCodigoTipRet != null && !this.cxpCodigoTipRet.equals(other.cxpCodigoTipRet))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "clases.CxpTipoContribuyente[ cxpCodigoTipCon=" + cxpCodigoTipRet + " ]";
    }
    
}
